import 'package:flutter/material.dart';
import 'package:qunaimedical/components/custom_divider.dart';
import 'package:qunaimedical/components/tabview.dart';
import 'package:qunaimedical/pages/records_page.dart';

/// 会诊记录
class ConsultationRecordsPage extends StatefulWidget {
  static const String routeName = '/records';

  @override
  _ConsultationRecordsPageState createState() =>
      _ConsultationRecordsPageState();
}

class _ConsultationRecordsPageState extends State<ConsultationRecordsPage> {
  PageController _controller = PageController();

  @override
  void dispose() {
    super.dispose();
    _controller.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('我的会诊'),
        elevation: 0,
      ),
      body: Column(
        children: [
          TabView(
            checkedIndex: 0,
            onChanged: (value) {
              _controller.jumpToPage(value);
            },
          ),
          CustomDivider(),
          Expanded(
            child: PageView(
              controller: _controller,
              physics: NeverScrollableScrollPhysics(),
              children: [
                RecordsPage(word: '1'),
                RecordsPage(word: '2'),
              ],
            ),
          ),
        ],
      ),
    );
  }
}
